<?php
  require_once('tpl/header.php');
?>
<?php 
	require_once('../system/dbConn.php');
	connect();
	require_once('../system/loginCheck.php');
	$vid=$_GET["vid"];
	$sql0="select * from videos where vid=$vid";
	$result0=mysql_query($sql0);//一条记录的结果集
	$row0=mysql_fetch_assoc($result0);//关联数组


 ?>

<form class="form-horizontal" action="doVideoUpdate.php" method="post" enctype="multipart/form-data">
	<input type="hidden" name="vid" value="<?php echo $vid; ?> ">
  <div class="form-group">
    <label for="inputName3" class="col-md-2 control-label">视频名称</label>
    <div class="col-md-6">
      <input type="text" class="form-control" id="inputName3" name="videoname" value="<?php echo $row0["videoname"]; ?> ">
    </div>
  </div>

   <div class="form-group">
    <label for="inputPassword" class="col-md-2 control-label">视频类型</label>
    <div class="col-md-6">
      <?php 
         require_once('../system/dbConn.php');
        connect();
        $sql="select * from videotype";
        $result=mysql_query($sql);       
       ?>
      <select class="form-control" name="videotype">
        <?php 
         while ($row=mysql_fetch_assoc($result)) {
         ?>
         <option value="<?php echo $row["tid"]; ?>" <?php 
         	if ($row0["tid"]==$row["tid"]) 
         	{
          		echo "selected";
          	} 
          ?>> <?php echo $row["typename"]; ?></option>
         <?php
        } 
        ?>
</select>
    </div>
  </div>

  <div class="form-group">
    <label for="inputBirthdate3" class="col-md-2 control-label">视频海报</label>
    <div class="col-md-6">
      <input type="file" id="inputBirthdate3" name="pic">
      原海报图片：<img src="../posters/<?php echo $row0["pic"] ?> " width="80" height="80" class="img-circle" alt="">
    </div>
  </div>

 <div class="form-group">
    <label for="inputintro" class="col-md-2 control-label">视频简介</label>
    <div class="col-md-6">
      <textarea name="intro" id="" cols="80" rows="5"><?php echo $row0["intro"]; ?> </textarea>
    </div>
  </div>


  <div class="form-group">
    <label for="inputEmail3" class="col-md-2 control-label">下载地址</label>
    <div class="col-md-6">
      <input type="text" class="form-control" id="inputEmail3" name="address" value="<?php echo $row0["address"]; ?> ">
    </div>
  </div>

  <div class="form-group">
    <div class="col-md-offset-2 col-md-10">
      <input type="submit" value="更新" class="btn btn-default">
    </div>
  </div>
</form>
   


<?php
  require_once('tpl/footer.php');
?>
